#include "Sort.h"
#include<time.h>
#include<stdlib.h>

void TestInsertSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	InsertSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintSort(arr, sizeof(arr) / sizeof(arr[0]));
}
void TestShellSort1()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	ShellSort1(arr, sizeof(arr) / sizeof(arr[0]));
	PrintSort(arr, sizeof(arr) / sizeof(arr[0]));
}
void TestShellSort2()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	ShellSort2(arr, sizeof(arr) / sizeof(arr[0]));
	PrintSort(arr, sizeof(arr) / sizeof(arr[0]));
}
void TestBubbleSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	BubbleSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintSort(arr, sizeof(arr) / sizeof(arr[0]));
}
void TestSelectSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	SelectSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintSort(arr, sizeof(arr) / sizeof(arr[0]));
}
void TestHeapSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	HeapSort(arr, sizeof(arr) / sizeof(arr[0]));
	PrintSort(arr, sizeof(arr) / sizeof(arr[0]));
}
void TestQuickSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 ,1,8,5,7,4,1,2,3,8,5,6,9};
	QuickSort(arr, 0, sizeof(arr) / sizeof(int) - 1);
	PrintSort(arr, sizeof(arr) / sizeof(int));
}
void TestQuickSortNonR()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10,1,8,5,7,4,1,2,3,8,5,6,9,10,1,8,5,7,4,1,2,3,8,5 };
	QuickSortNonR(arr, 0, sizeof(arr) / sizeof(int) - 1);
	PrintSort(arr, sizeof(arr) / sizeof(int));
}
void TestMergeSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	MergeSort(arr, sizeof(arr) / sizeof(int));
	PrintSort(arr, sizeof(arr) / sizeof(int));
}
void TestMergeSortNotR()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	_MergeSortNotR(arr, sizeof(arr) / sizeof(int));
	PrintSort(arr, sizeof(arr) / sizeof(int));
}
void TestCountSort()
{
	int arr[] = { 1,8,5,7,4,1,2,3,8,5,6,9,10 };
	CountSort(arr, sizeof(arr) / sizeof(int));
	PrintSort(arr, sizeof(arr) / sizeof(int));
}


int main()
{
	TestInsertSort();
	TestShellSort1();
	TestShellSort2();
	TestBubbleSort();
	TestSelectSort();
	TestHeapSort();
	TestQuickSort();
	TestQuickSortNonR();
	TestMergeSortNotR();
	TestMergeSort();
	TestCountSort();


	return 0;
}